Reverted to 'print' and added few extra debug messages.