Check if user is on backend page

You can use is_admin(); in your if query , http://codex.wordpress.org/Function_Reference/is_admin

error code: 523