added command argument conversion, type checks and exception handling