moved pwd encryption to the model
fix for checking if a port is in use.