Added logging and successfully tested