added console debug log functionality