Added logging for debug purposes.